import NotFound from "../components/404";
import Login from "../components/login";
import Main from "../components/main";
import About from "../components/main/about";
import Home from "../components/main/home";
import {useRoutes} from 'react-router-dom'
import News from "../components/main/home/news";
import Hobby from "../components/main/home/hobby";
const routes = [
    {
        path : '/login',
        element : <Login/>
    },{
        path : '/main',
        element : <Main/>,
        children:[
            {
                path : '/main/about',
                element : <About/>
            },{
                path : '/main/home',
                element : <Home/>,
                children:[
                    {
                        path : '/main/home/news',
                        element : <News/>
                    },{
                        path : '/main/home/hobby',
                        element : <Hobby/>
                    },
                ]
            },
        ]
    },{
        path : '/login',
        element : <Login/>
    },{
        path : '/',
        element : <Login/>
    },{
        path : '/*',
        element : <NotFound/>
    },
]
export default routes;

export const GetRoutes = () =>{
    return useRoutes(routes)
}

